//
//  ViewNavigationBar.m
//  Youhuiju
//
//  Created by liuovyue on 16/9/21.
//  Copyright © 2016年 yutenys. All rights reserved.
//

#import "ViewNavigationBar.h"

@implementation ViewNavigationBar

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
    
        
        [self createNavigationBar];
    }
    return self;
    
}


- (void)createNavigationBar{
    
    
    
    
    
    
    
    
    self.labelTitle = [[UILabel alloc]init];
    //self.labelTitle.text = @"修改昵称";
    self.labelTitle.textAlignment = NSTextAlignmentCenter;
    self.labelTitle.textColor = [UIColor blackColor];
    self.labelTitle.font = [UIFont systemFontOfSize:18*FitW];
    [self addSubview:self.labelTitle];
    
    [_labelTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        
        //make.top.equalTo(self.viewBar.mas_top);
        make.left.equalTo(self.mas_left).offset(100*FitW);
        make.right.equalTo(self.mas_right).offset(-100*FitW);
        make.bottom.equalTo(self.mas_bottom).offset(-14*FitH);
        
        
        
    }];
    //返回按钮
    self.buttonReturn = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.buttonReturn setImage:[UIImage imageNamed:@"zfanhuijian"] forState:UIControlStateNormal];
    //[self.buttonReturn addTarget:self action:@selector(tuihuiAcion:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:self.buttonReturn];
    
    [_buttonReturn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.mas_left).offset(17*FitW);
        make.width.mas_equalTo(22*FitW);
        make.height.mas_equalTo(22*FitH);
        make.bottom.equalTo(self.mas_bottom).offset(-13*FitH);
        
        
        
    }];
    

    
    
}








@end
